SOURCES = $(wildcard *.nas) 
OBJS = $(SOURCES:%.nas=%.obj)
OBJS_BIN = ${wildcard ${lib.bin}*.obj}

TOOLPATH = ../z_tools/
INCPATH  = ../z_tools/haribote/

MAKE     = $(TOOLPATH)make.exe -r
NASK     = $(TOOLPATH)nask.exe
CC1      = $(TOOLPATH)cc1.exe -I$(INCPATH) -Os -Wall -quiet
GAS2NASK = $(TOOLPATH)gas2nask.exe -a
OBJ2BIM  = $(TOOLPATH)obj2bim.exe
MAKEFONT = $(TOOLPATH)makefont.exe
BIN2OBJ  = $(TOOLPATH)bin2obj.exe
BIM2HRB  = $(TOOLPATH)bim2hrb.exe
RULEFILE = ../haribote.rul
EDIMG    = $(TOOLPATH)edimg.exe
IMGTOL   = $(TOOLPATH)imgtol.com
GOLIB    = $(TOOLPATH)golib00.exe 
COPY     = copy
DEL      = del.bat
bin      = ../bin/
lib.bin  = bin/

default :
	$(MAKE) system-api.lib

system-api.lib : $(OBJS) Makefile 
	$(GOLIB) $(OBJS_BIN) out:$(bin)system-api.lib


%.obj : %.nas Makefile
	$(NASK) $*.nas $(lib.bin)$*.obj  $(lib.bin)$*.lst

clear :
	$(DEL) /S /Q bin
	
